FROM python:3.9.5

WORKDIR /app

COPY ./requirements.txt ./
# RUN pip install --upgrade pip -i https://pypi.tuna.tsinghua.edu.cn/simple
RUN https_proxy="" http_proxy="" all_proxy="" HTTPS_PROXY="" HTTP_PROXY="" ALL_PROXY="" pip3 install --no-cache-dir -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple

# Create and switch to user
ARG user=jenkins
ARG group=jenkins
ARG uid=1000
ARG gid=1000
RUN groupadd -g ${gid} ${group}
RUN useradd -u ${uid} -g ${group} -s /bin/sh -m ${user}
USER ${uid}:${gid}

CMD [ "hrun", "testcases/", "--clean-alluredir", "--alluredir=reports", "--junit-xml=report.xml" ]

